#!/bin/bash
source include_bench.sh

# backup 
mv ./log/result.tsv ./log/result_old.tsv

echo "lib bench threads result(mop/s)" > ./log/result.tsv



trap "exit" INT
echo "run ${1} x 2 times (gcc + clang)" 
for ((i=1;i<=${1};i++))
do
	for lib in ${liblist}   
	do
		do_bench ${curpath}/build_lib/glibapfsds_${lib}.so ${curpath}/build/gtest_basic.o ${lib} ./log/result.tsv
		do_bench ${curpath}/build_lib/cllibapfsds_${lib}.so ${curpath}/build/cltest_basic.o ${lib} ./log/result.tsv
	done
done

cd script
python3 geomean.py ../log/result.tsv
